<?php

namespace App\Providers;

use App\Events\CreateOrder;
use App\Events\Refund;
use App\Listeners\BindTableRecordOrderNo;
use App\Listeners\NotifyOrderPaid;
use App\Listeners\NotifyOrderPaying;
use App\Listeners\NotifyOrderPaymentFailed;
use App\Listeners\NotifyRechargePaid;
use App\Listeners\NotifyRechargePaymentFailed;
use App\Listeners\Refund\Balance;
use App\Listeners\Refund\BankCard;
use App\Listeners\Refund\Cash;
use App\Listeners\Refund\MailPos;
use App\Listeners\Refund\Shouqianba;
use App\Listeners\Refund\WxPay;
use App\Listeners\Refund\AliPay;
use D1M\Payment\Events\PaymentFailed;
use D1M\Payment\Events\PaymentPaid;
use D1M\Payment\Events\PaymentPaying;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
        CreateOrder::class=>  [
            BindTableRecordOrderNo::class,
        ],
        Refund::class => [
            Balance::class,
            Shouqianba::class,
            AliPay::class,
            WxPay::class,
            BankCard::class,
            Cash::class,
            MailPos::class
        ],
        PaymentPaid::class => [
            NotifyOrderPaid::class,
            NotifyRechargePaid::class,
        ],
        PaymentPaying::class => [
            NotifyOrderPaying::class,
        ],
        PaymentFailed::class => [
            NotifyOrderPaymentFailed::class,
            NotifyRechargePaymentFailed::class,
        ]
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
